﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Model.Catalog;

namespace OnlineFloralShop.Common
{
    public class CommonController
    {

        //Status of Product
        //Out of Stock OR In Stock
        public static string StatusStore(int quantity)
        {
            if (quantity > 0)
            {
                return "In Stock";
            }
            else
            {
                return "Out of Stock";
            }
            
        }

        //-------------------------------------------------------//
        //Check Quantity from Data with customer add to cart
        //Check So luong mua co lon hon trong data khong
        public static bool CheckQuantityAddToCart(string ProductId, int quantity)
        {

            if (int.Parse(Model.Catalog.Product.GetProductDetailByProductId(ProductId).Rows[0]["Quantity"].ToString()) >= quantity)
            {
                return false;
            }
            else
            {
                return true;
            }


        }
    }

}
